﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ACM.Master" AutoEventWireup="true" CodeBehind="Detail.aspx.cs" Inherits="ACM.Detail" %>
<%@ Register Src="~/UserControls/StatusPanel.ascx" TagPrefix="uc" TagName="StatusPanel" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="StatusPlaceHolder" runat="server">
    <uc:StatusPanel ID="Status" runat="server"></uc:StatusPanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="server">
    <div class="page-header" style="margin-top: 0;">
        <h1>ยืนยันข้อมูลการขาย</h1>
    </div>

    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <table class="table table-striped">

                <tr>
                    <td>ชื่อ - นามสกุลลูกค้า :</td>
                    <td>
                        <asp:Label ID="lblCustomerName" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>หมายเลข<asp:Label ID="lblCardType" runat="server" Text="บัตรประชาชน"></asp:Label> : &nbsp;&nbsp;</td>
                    <td>
                        <asp:Label ID="lblIdCard" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>VIN :</td>
                    <td>
                        <asp:Label ID="lblVIN" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>รุ่นรถ :</td>
                    <td>
                        <asp:Label ID="lblSeries" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>รุ่นย่อย :</td>
                    <td>
                        <asp:Label ID="lblSubseries" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>แคมเปญ ณ วันแจ้งขาย :</td>
                    <td>
                        <asp:Label ID="lblSaleCampaign" runat="server"></asp:Label>
                    </td>
                </tr>


                <tr>
                    <td>แคมเปญ ณ วันส่งมอบ :</td>
                    <td>
                        <asp:Label ID="lblDeliveryCampaign" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td >ส่วนต่าง :</td>
                    <td >
                        <asp:Label ID="lblDiff" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td style="background-color:#f7fa00;">Samsung GALAXY Note 4 :</td>
                    <td style="background-color:#f7fa00;">
                        <asp:Label ID="lblSpecial" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td style="background-color:#f7fa00;">ยอดที่ได้รับ :</td>
                    <td style="background-color:#f7fa00;">
                        <asp:Label ID="lblSum" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>วันที่ Retail Sales ใน DDMS :</td>
                    <td>
                        <asp:Label ID="lblSaleDate" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>วันที่ส่งมอบ :</td>
                    <td>
                        <asp:Label ID="lblDeliveryDate" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>ที่อยู่ :</td>
                    <td>
                        <div class="row">
                            <div class="col-md-6">
                                บ้านเลขที่ :
                                    <asp:Label ID="lblAddressNo" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-6">
                                หมู่บ้าน :
                                    <asp:Label ID="lblVillage" runat="server"></asp:Label>
                            </div>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <div class="row">
                            <div class="col-md-6">
                                หมู่ที่ :
                                    <asp:Label ID="lblGroupNo" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-6">
                                ตรอก/ซอย :
                                    <asp:Label ID="lblAlley" runat="server"></asp:Label>
                            </div>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <div class="row">
                            <div class="col-md-6">
                                ชื่่ออาคาร :
                                    <asp:Label ID="lblBuilding" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-6">
                                ห้องเลขที่ :
                                    <asp:Label ID="lblRoomNo" runat="server"></asp:Label>
                            </div>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <div class="row">
                            <div class="col-md-6">
                                ชั้นที่ :
                                    <asp:Label ID="lblFloor" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-6">
                                ถนน :
                                    <asp:Label ID="lblRoad" runat="server"></asp:Label>
                            </div>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <div class="row">
                            <div class="col-md-6">
                                ตำบล/แขวง :
                                    <asp:Label ID="lblParish" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-6">
                                อำเภอ/เขต :
                                    <asp:Label ID="lblDistrict" runat="server"></asp:Label>
                            </div>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <div class="row">
                            <div class="col-md-6">
                                จังหวัด :
                                    <asp:Label ID="lblProvince" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-6">
                                รหัสไปรษณีย์ :
                                    <asp:Label ID="lblPostCode" runat="server"></asp:Label>
                            </div>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>Attached File :</td>
                    <td>
                        <asp:HyperLink ID="lnkAttack" runat="server">
                            <asp:Label ID="lblAttachFileName" runat="server"></asp:Label></asp:HyperLink>
                    </td>
                </tr>

                <tr>
                    <td colspan="2" style="text-align: center;">
                        <asp:HiddenField ID="hdfTxId" runat="server" />
                        <br />
                        <a href="#" class="btn btn-default" onclick="javascript:history.back();" >กลับ</a>
                    </td>
                </tr>

            </table>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="script" runat="server">
    <script type="text/javascript">
        ActiveMenuIndex(1);

        $('.dateInput').attr('readonly', true);

        $('.modalImage').magnificPopup({
            type: 'image',
            //removalDelay: 500,
            callbacks: {
                beforeOpen: function () {
                    this.st.mainClass = this.st.el.attr('data-effect');

                    var tx = $('#<%= hdfTxId.ClientID %>').val();
                    
                    if("<%= CurrentUser.user_role %>" == "ro")
                    {
                        $.ajax({
                            type: "GET",
                            url: "StampViewDoc.ashx",
                            data: { txId: tx, UserID: <%= CurrentUser.id %>},
                            dataType: "text",
                            success: function (response) {
                                //if(response != "success")
                                //    alert("Can't submit view document time data.");
                            },
                            failure: function (response) {
                                alert("Can't submit view document time data.");
                            },
                            error: function (response) {
                                alert("Can't submit view document time data.");
                            }
                        });
                    }
                }
            }
        });

        $('#<%= lnkAttack.ClientID %>').click(function(){
            var attr = $(this).attr('target');
            if (typeof attr !== typeof undefined && attr !== false) {
                //alert('pdf');
                
                $.ajax({
                    type: "GET",
                    url: "StampViewDoc.ashx",
                    data: { txId: $('#<%= hdfTxId.ClientID %>').val() , UserID: <%= CurrentUser.id %>},
                            dataType: "text",
                            success: function (response) {
                                //if(response != "success")
                                //    alert("Can't submit view document time data.");
                            },
                            failure: function (response) {
                                alert("Can't submit view document time data.");
                            },
                            error: function (response) {
                                alert("Can't submit view document time data.");
                            }
                });
            }
        });
    </script>
</asp:Content>
